//
// Created by Administrator on 2023/8/4.
//
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    double calculateTax(vector<vector<int>> &brackets, int income) {
        double res = 0;
        int lower = 0;
        for (auto &bracket: brackets) {
            if (income < bracket[0]) {
                return res + double((income - lower) * bracket[1]) / 100;
            }
            res += double((bracket[0] - lower) * bracket[1]) / 100;
            lower = bracket[0];
        }
        return res;
    }
};

int main() {
    Solution s;
    vector<vector<int>> brackets{{3,  50},
                                 {7,  10},
                                 {12, 25}};
    cout << s.calculateTax(brackets, 10) << endl;
    return 0;
}